package com.hsh;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;

import static org.apache.poi.util.TempFile.JAVA_IO_TMPDIR;

/**
 * http://127.0.0.1:9999/doc.html
 * <p>
 * maven:3.6.3
 * jdk:1.8
 * <p>
 * springboot:2.3.4.FINAL(mapstruct)
 */
@EnableScheduling
@MapperScan("com.hsh.mapper")
@SpringBootApplication(scanBasePackages = "com.hsh")
public class App implements ApplicationRunner {

    private static final Logger logger = LoggerFactory.getLogger(App.class);

    @Value("${javaIoTmpdir}")
    private String ioTmpDir;

    public static void main(String[] args) {
        SpringApplication.run(App.class, args);
        logger.info("-------------项目启动----------------");
    }

    @Override
    public void run(ApplicationArguments args) {
        System.setProperty(JAVA_IO_TMPDIR, ioTmpDir);
        logger.info("java.io.tmpdir--> {}", System.getProperty(JAVA_IO_TMPDIR));
    }
}
